import $getScript from './getScript'
import '../vendor/simple-crop/simple-crop.css'

function getSimpleCrop () {
	return new Promise(resolve => {
		if (window.SimpleCrop) {
			resolve(window.SimpleCrop)
		} else {
			$getScript({
				src: '//img.yangshipin.cn/assets/simplecropmin-k67pp8eu8l7f.js',
				onLoad() {
					resolve(window.SimpleCrop)
				}
			})
		}
	})
}

export default getSimpleCrop
